package org.yuyao.biz1.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.yuyao.biz1.providerclient.RemoteOrderClient;
import org.yuyao.biz1.providerclient.RemoteOrgClient;
import org.yuyao.biz1.providerclient.RemoteUserClient;
import org.yuyao.biz1.service.UserService;
import org.yuyao.common.domain.vo.YuyaoResponse;

@RestController
@RequestMapping("biz")
public class BizController {

    @Autowired
    private RemoteUserClient remoteUserClient;

    @Autowired
    private RemoteOrderClient remoteOrderClient;

    @Autowired
    private RemoteOrgClient remoteOrgClient;

    @Autowired
    private UserService userService;

    @GetMapping("getList")
    public YuyaoResponse getList() {
        return YuyaoResponse.success(remoteUserClient.getUserName());
    }

    @GetMapping("getOrderNo")
    public YuyaoResponse getOrderNo() {
        return YuyaoResponse.success(remoteOrderClient.getOrderNo("DD009"));
    }

    @GetMapping("findOrderList")
    public YuyaoResponse findOrderList() {
        return YuyaoResponse.success(remoteOrderClient.getList());}

    @GetMapping("getOrgName")
    public YuyaoResponse getOrgName() {
        return YuyaoResponse.success(remoteOrgClient.getOrgName());}
}
